package rn;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class OracleConnection implements IConnection {
	Connection con;
	public Connection establecerConexion() {
		//cargar driver
		try {
			 DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
		} catch (Exception e) {
			e.printStackTrace();
		}
		//establecer conexion con la base de datos		
		try {
			con  = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","root","root");
		}
		catch (SQLException e) {
			e.printStackTrace();
		}
		
		return con;
	}
}
